package com.java.dp.proxy;

/**
 * @Author lizhilong
 * @create 2019/12/3 13:46
 * @desc
 */
public class ProxyMain {
   /* public static void main(String[] args) {
        BuyTicket buyTicket = new XiechengProxy(new UserByTicket());
        buyTicket.buyTickt();
    }*/
    /*public static void main(String[] args) {
        BuyTicket buyTicket = new UserByTicket();
        BuyTicket buyTicketProxy = (BuyTicket) Proxy.newProxyInstance(buyTicket.getClass().getClassLoader(),new Class[]{BuyTicket.class},new JDKProxy(buyTicket));
        buyTicketProxy.buyTickt();
    }*/

    public static void main(String[] args) {
        CGLibProxy cgLibProxy = new CGLibProxy();
        BuyTicket buyTicket = new UserByTicket();
        BuyTicket cglibProxy = (BuyTicket) cgLibProxy.getPorxyInstance(buyTicket);
        cglibProxy.buyTickt();
    }
}
